<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 300px;
            height: 100px;
            background-color: red;
        }

        /* hover自己，改变自己的样式 */
        .box:hover {
            border: 5px solid black;
        }

        /* hover父标签，改变子标签的样式 */
        .box:hover h1 {
            color: #fff;
        }
    </style>
</head>

<body>
    <div class="box">
        <h1>内部子标签</h1>
    </div>
</body>

</html>